package com.sduept.nwld.dataserver.controller.equipment.assessment.statistics;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

import org.springframework.beans.factory.annotation.Autowired;

import com.sduept.bigdata.equipment.assessment.dto.DepartQuestionEquipmentDTO;
import com.sduept.bigdata.equipment.assessment.model.inspection.InspectionQuestionEquipment;
import com.sduept.bigdata.equipment.assessment.service.InspectionPlanService;
import com.sduept.bigdata.equipment.assessment.service.InspectionQuestionEquipmentService;
import com.sduept.bigdata.equipment.assessment.service.InspectionStationService;
import com.sduept.bigdata.equipment.assessment.service.InspectionStatisticalAnalysisService;
import com.sduept.bigdata.web.jsf.controller.AbstractController;

/**
 * 评价分析--问题等级分析--详情页面
 * @author zht
 *
 */
@Named
@ViewScoped
public class InspectionRiskLevelDetailAnalysisController extends AbstractController{

	private static final long serialVersionUID = 2772433574982044148L;
	
	@Autowired
	private InspectionStatisticalAnalysisService analysisService;
	
	
	private List<DepartQuestionEquipmentDTO> inspectionQuestionEquipments=new ArrayList<>();
	private String acceptName ;
	private String riskLevel ;
	
	@PostConstruct
	public void init() {
		try {
			acceptName = URLDecoder.decode(getParameter("acceptName"), "utf-8");
			riskLevel = URLDecoder.decode(getParameter("riskLevel"), "utf-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
		}
		String planId=getParameter("planId");
		setInspectionQuestionEquipments(analysisService.getDepartQuestionEquipmentDTOByPlanIdAndDepart4RiskLevel(planId,acceptName, riskLevel));
	}

	public String getAcceptName() {
		return acceptName;
	}

	public void setAcceptName(String acceptName) {
		this.acceptName = acceptName;
	}

	public String getRiskLevel() {
		return riskLevel;
	}

	public void setRiskLevel(String riskLevel) {
		this.riskLevel = riskLevel;
	}

	public List<DepartQuestionEquipmentDTO> getInspectionQuestionEquipments() {
		return inspectionQuestionEquipments;
	}

	public void setInspectionQuestionEquipments(List<DepartQuestionEquipmentDTO> inspectionQuestionEquipments) {
		this.inspectionQuestionEquipments = inspectionQuestionEquipments;
	}

	
}
